<?php
class LoginController extends Controller{

private $db ;//模型
public function __init(){
	$this->db=new AdminModel;
}

// 登陆

public function Login(){
	
	if(IS_POST){
      if($this->db->userLogin($_POST)){
      	
        $this->success('登陆成功',__MODEL__);
      }else{
    
      	  $this->error($this->db->error);
      }
	}else{

      $this->display('login.html');
	}
}

// 退出
public function out(){
	session_unset();
	session_destroy();
	$this->success('退出成功',__CONTROLLER__.'&a=login');
}


}





?>